<extend name="Public:common"/>
<block name="css">
    <style>
        th{text-align:center;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1><i class="fa fa-home"></i> 首页>产品管理>线路管理>{$info.line_name}>合作的运营商</h1></div>
    <div class="tab-content">
        <div class="col-xs-12"  style="margin-top:10px;">
            <if condition="checkAuth('Dealer/Shops/addLinePartner')">
                <a href="javascript:addLinePartner({:I('id')})" class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">添加新的合作运营商</a>
            </if>
        </div>

        <div class="container-fluid">
             <table class="table table-striped table-bordered table-hover table-condensed text-center detail">
                 <tbody>
                     <tr>
                        <th>ID</th>
                        <th>运营商名称</th>
                        <th>申请合作时间</th>
                        <th>合作状态</th>
                     </tr>
                     <volist name="list" id="vo">
                         <tr>
                             <td>{$vo.partner_id}</td>
                             <td>{$vo.operator_name}</td>
                             <td>{$vo.create_time|date="Y-m-d",###}</td>
                             <td>
                                 <switch name="vo.partner_status">
                                     <case value="1">合作中</case>
                                     <case value="0">申请合作中</case>
                                     <case value="-1">运营商拒绝</case>
                                     <case value="-2">供应商取消合作</case>
                                 </switch>
                             </td>
                         </tr>
                     </volist>
                     <tr>
                         <td colspan="4">
                             <!--分页样式-->
                             <ul class="pagination">
                                 {$show}
                             </ul>
                         </td>
                     </tr>
                     </tbody>
                 </tbody>
             </table>

        </div>
    </div>
</block>
<block name="js">
    <script>
        function addLinePartner(id) {
            var url="{:U('addLinePartner',array('id'=>I('id')))}";
            layer.open({
                title:'新增运营商合作',
                offset:'80px',
                area: ['80%', '80%'],
                type: 2,
                content: url,
                end:function(){
                    location.reload();
                }
            });
        }
    </script>
</block>